<?php

class MTaiKhoan extends CI_Model
{
	function dangki($username, $password, $hoten, $email, $phone, $company, $address)
	{
		$this->db->set('username', $username);
		$this->db->set('password', $password);
		$this->db->set('hoten', $hoten);
		$this->db->set('email', $email);
		$this->db->set('phone', $phone);
		$this->db->set('company', $company);
		$this->db->set('address', $address);
		$this->db->insert('taikhoan');
	}
	
	function kiemtrataikhoan($username)
	{
		$this->db->where('username', $username);
		return $this->db->get('taikhoan')->num_rows() == 1 ? true : false;
	}
	
	function kiemtralogin($username, $password)
	{
		$this->db->where('username', $username);
		$this->db->where('password', $password);
		return $this->db->get('taikhoan')->num_rows() == 1 ? true : false;
	}
	
	
}

?>